//
//  CashHomeHeadView.m
//  CashBook
//
//  Created by 吴斌 on 2024/9/4.
//

#import "CashHomeHeadView.h"
@interface CashHomeHeadView()
@property (nonatomic, strong)UILabel * allIconLab;
@property (nonatomic, strong)UILabel * cashHomePaylab;
@property (nonatomic, strong)UILabel * cashHomeIncomelab;
@end
@implementation CashHomeHeadView
-(instancetype)init{
    if (self == [super init]) {
        [self creatSubView];
    }
    return self;
}
- (void)creatSubView{
    UIView *cashHomeHeadView = [[UIView alloc] init];
    cashHomeHeadView.backgroundColor = [UIColor whiteColor];
    cashHomeHeadView.layer.cornerRadius = 15;
    cashHomeHeadView.clipsToBounds = true;
    [self addSubview:cashHomeHeadView];
    [cashHomeHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(20));
        make.right.equalTo(@(-20));
        make.top.equalTo(@(10));
        make.height.equalTo(@(200));
    }];
    UILabel *allIconHeadLab = [[UILabel alloc] init];
    allIconHeadLab.textColor = UIColor.blackColor;
    allIconHeadLab.text = @"总资产:";
    allIconHeadLab.font = [UIFont systemFontOfSize:20 weight:UIFontWeightRegular];
    [cashHomeHeadView addSubview:allIconHeadLab];
    [allIconHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(15));
        make.top.equalTo(@(15));
        make.height.equalTo(@(40));
    }];
    self.allIconLab = [[UILabel alloc] init];
    self.allIconLab.textColor = UIColor.blackColor;
    self.allIconLab.text = @"0";
    self.allIconLab.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
    [cashHomeHeadView addSubview:self.allIconLab];
    [self.allIconLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(allIconHeadLab.mas_right).offset(10);
        make.centerY.equalTo(allIconHeadLab);
        make.height.equalTo(@(40));
    }];
    
    UIView *cashHomeLineView = [[UIView alloc] init];
    cashHomeLineView.backgroundColor = [UIColor whiteColor];
    [cashHomeHeadView addSubview:cashHomeLineView];
    [cashHomeLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(cashHomeHeadView);
        make.top.equalTo(self.allIconLab.mas_bottom).offset(15);
        make.bottom.equalTo(@(0));
    }];
    
    UILabel *cashHomePayHeadlab = [[UILabel alloc] init];
    cashHomePayHeadlab.textColor = UIColor.grayColor;
    cashHomePayHeadlab.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
    cashHomePayHeadlab.text = @"本月支出";
    cashHomePayHeadlab.textAlignment = NSTextAlignmentCenter;
    [cashHomeHeadView addSubview:cashHomePayHeadlab];
    [cashHomePayHeadlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(0));
        make.top.equalTo(self.allIconLab.mas_bottom).offset(15);
        make.right.equalTo(cashHomeLineView);
    }];
    self.cashHomePaylab = [[UILabel alloc] init];
    self.cashHomePaylab.textColor = UIColor.blackColor;
    self.cashHomePaylab.text = @"0";
    self.cashHomePaylab.font = [UIFont systemFontOfSize:40 weight:UIFontWeightBold];
    [cashHomeHeadView addSubview:self.cashHomePaylab];
    [self.cashHomePaylab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(cashHomePayHeadlab);
        make.top.equalTo(cashHomePayHeadlab.mas_bottom).offset(15);
    }];
    
   
    
    
    UILabel *cashHomeIncomeHeadlab = [[UILabel alloc] init];
    cashHomeIncomeHeadlab.textColor = UIColor.grayColor;
    cashHomeIncomeHeadlab.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
    cashHomeIncomeHeadlab.text = @"本月收入";
    cashHomeIncomeHeadlab.textAlignment = NSTextAlignmentCenter;
    [cashHomeHeadView addSubview:cashHomeIncomeHeadlab];
    [cashHomeIncomeHeadlab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(cashHomeLineView.mas_right);
        make.top.equalTo(cashHomePayHeadlab);
        make.width.equalTo(cashHomePayHeadlab);
    }];
    self.cashHomeIncomelab = [[UILabel alloc] init];
    self.cashHomeIncomelab.textColor = UIColor.blackColor;
    self.cashHomeIncomelab.text = @"0";
    self.cashHomeIncomelab.font = [UIFont systemFontOfSize:40 weight:UIFontWeightBold];
    [cashHomeHeadView addSubview:self.cashHomeIncomelab];
    [self.cashHomeIncomelab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(cashHomeIncomeHeadlab);
        make.top.equalTo(cashHomeIncomeHeadlab.mas_bottom).offset(15);
    }];
}
@end
